# 调用高德交通势态api
import requests

def traffic(name,city):
    url = 'https://restapi.amap.com/v3/traffic/status/road?'
    params = {
        'key': '填入你的key',
        'name': name,
        'city': city,

    }
    response = requests.get(url, params)
    results = response.json()
    return results